﻿using System.Linq;
using System.Threading.Tasks;

namespace BlondeHeaven.DAL
{
    public interface IDalUserService<T> where T : class, new()
    {
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        T Add(T model);
        IQueryable<T> GetAll();
        /// <summary>
        /// 查询一个用户
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        Task<T> GetOneById(int Id);
        /// <summary>
        /// 编辑
        /// </summary>
        /// <param name="model"></param>
        /// <param name="saved"></param>
        /// <returns></returns>
        Task EditAsync(T model, bool saved = true);
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="Id"></param>
        /// <param name="saved"></param>
       /// <returns></returns>
        Task RemoveAsync(bool saved = true);
        int SaveChanges();

    }
}
